package com.love.poetry.infrastructure.util;

public class JsonMessage {
	
	public enum State {
		SUCCESS, WARNNING, ERROR, COMPANYNAMEEXIST, MOBILEPHONEEXIST, TELEPHONEEXIST, QQEXITS, USEREXIST
	}

	private JsonMessage() {
	}

	public JsonMessage message(String message) {
		this.message = message;
		return this;
	}

	private State state;
	private String message;

	public State getState() {
		return state;
	}

	public String getMessage() {
		return message;
	}

	public static JsonMessage one() {
		return new JsonMessage();
	}

	public JsonMessage success() {
		this.state = State.SUCCESS;
		return this;
	}

	public JsonMessage warnning() {
		this.state = State.WARNNING;
		return this;
	}

	public JsonMessage error() {
		this.state = State.ERROR;
		return this;
	}

	public JsonMessage companyNameExist() {
		this.state = State.COMPANYNAMEEXIST;
		return this;
	}

	public JsonMessage mobilePhoneExist() {
		this.state = State.MOBILEPHONEEXIST;
		return this;
	}

	public JsonMessage telePhoneExist() {
		this.state = State.TELEPHONEEXIST;
		return this;
	}

	public JsonMessage qqExist() {
		this.state = State.QQEXITS;
		return this;
	}

	public JsonMessage userExist() {
		this.state = State.USEREXIST;
		return this;
	}

}
